<template>
  <a-drawer
    width="576"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="24" >
            <a-form-model-item label="客户类别" prop="customerCategory">
              <a-select
                placeholder="请选择客户类别"
                v-model="form.customerCategory"
                :getPopupContainer="
                  triggerNode => {
                    return triggerNode.parentNode || document.body
                  }
                "
                style="width: 100%"
                allow-clear>
                <a-select-option v-for="(d, index) in customerCategoryOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="客户编码" prop="customerCode">
              <a-input v-model="form.customerCode" placeholder="请输入客户编码"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="客户名称" prop="customerName">
              <a-input v-model="form.customerName" placeholder="请输入客户名称"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="助记码">
              <a-input v-model="form.mnemonicCode" placeholder="请输入助记码"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="清账发货" prop="isClear">
              <a-radio-group v-model="form.isClear" button-style="solid">
                <a-radio-button
                  v-for="(dict, index) in isClearOptions"
                  :key="index"
                  :value="dict.dictValue"
                >
                  {{ dict.dictLabel }}
                </a-radio-button>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="联系电话" >
              <a-input v-model="form.phone" placeholder="请输入联系电话"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="联系人" >
              <a-input v-model="form.contactPerson" placeholder="请输入联系人"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="售价模式" prop="sellMode">
              <a-select
                placeholder="请选择售价模式"
                v-model="form.sellMode"
                :getPopupContainer="
                  triggerNode => {
                    return triggerNode.parentNode || document.body
                  }
                "
                style="width: 100%"
                allow-clear>
                <a-select-option v-for="(d, index) in sellModeOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="业务员">
              <select-user
                v-model="form.customernan"
                  select-model="single"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="描述" prop="remark">
              <a-textarea v-model="form.remark" placeholder="请输入描述" :rows="4"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
            保存
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizCustomerEditForm from './BizCustomerForm'
export default {
  ...BizCustomerEditForm
}
</script>
